.class final Lcom/ninesky/browser/view/bg;
.super Landroid/widget/BaseAdapter;


# instance fields
.field private a:Ljava/util/List;

.field private b:Landroid/os/AsyncTask;

.field private c:Landroid/content/Context;

.field private d:Landroid/graphics/Bitmap;

.field private synthetic e:Lcom/ninesky/browser/view/j;


# direct methods
.method public constructor <init>(Lcom/ninesky/browser/view/j;Landroid/content/Context;)V
    .locals 2

    iput-object p1, p0, Lcom/ninesky/browser/view/bg;->e:Lcom/ninesky/browser/view/j;

    invoke-direct {p0}, Landroid/widget/BaseAdapter;-><init>()V

    iput-object p2, p0, Lcom/ninesky/browser/view/bg;->c:Landroid/content/Context;

    iget-object v0, p0, Lcom/ninesky/browser/view/bg;->c:Landroid/content/Context;

    invoke-virtual {v0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object v0

    const v1, 0x7f020001

    invoke-static {v0, v1}, Landroid/graphics/BitmapFactory;->decodeResource(Landroid/content/res/Resources;I)Landroid/graphics/Bitmap;

    move-result-object v0

    iput-object v0, p0, Lcom/ninesky/browser/view/bg;->d:Landroid/graphics/Bitmap;

    return-void
.end method

.method static synthetic a(Lcom/ninesky/browser/view/bg;)Landroid/content/Context;
    .locals 1

    iget-object v0, p0, Lcom/ninesky/browser/view/bg;->c:Landroid/content/Context;

    return-object v0
.end method

.method static synthetic a(Lcom/ninesky/browser/view/bg;Ljava/util/List;)V
    .locals 0

    iput-object p1, p0, Lcom/ninesky/browser/view/bg;->a:Ljava/util/List;

    return-void
.end method

.method static synthetic b(Lcom/ninesky/browser/view/bg;)Landroid/graphics/Bitmap;
    .locals 1

    iget-object v0, p0, Lcom/ninesky/browser/view/bg;->d:Landroid/graphics/Bitmap;

    return-object v0
.end method


# virtual methods
.method public final a()V
    .locals 2

    iget-object v0, p0, Lcom/ninesky/browser/view/bg;->b:Landroid/os/AsyncTask;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/ninesky/browser/view/bg;->b:Landroid/os/AsyncTask;

    const/4 v1, 0x1

    invoke-virtual {v0, v1}, Landroid/os/AsyncTask;->cancel(Z)Z

    :cond_0
    new-instance v0, Lcom/ninesky/browser/view/av;

    invoke-direct {v0, p0}, Lcom/ninesky/browser/view/av;-><init>(Lcom/ninesky/browser/view/bg;)V

    iput-object v0, p0, Lcom/ninesky/browser/view/bg;->b:Landroid/os/AsyncTask;

    iget-object v0, p0, Lcom/ninesky/browser/view/bg;->b:Landroid/os/AsyncTask;

    const/4 v1, 0x0

    new-array v1, v1, [Ljava/lang/Void;

    invoke-virtual {v0, v1}, Landroid/os/AsyncTask;->execute([Ljava/lang/Object;)Landroid/os/AsyncTask;

    return-void
.end method

.method public final getCount()I
    .locals 1

    iget-object v0, p0, Lcom/ninesky/browser/view/bg;->a:Ljava/util/List;

    if-nez v0, :cond_0

    const/4 v0, 0x0

    :goto_0
    return v0

    :cond_0
    iget-object v0, p0, Lcom/ninesky/browser/view/bg;->a:Ljava/util/List;

    invoke-interface {v0}, Ljava/util/List;->size()I

    move-result v0

    goto :goto_0
.end method

.method public final getItem(I)Ljava/lang/Object;
    .locals 1

    iget-object v0, p0, Lcom/ninesky/browser/view/bg;->a:Ljava/util/List;

    if-nez v0, :cond_0

    const/4 v0, 0x0

    :goto_0
    return-object v0

    :cond_0
    iget-object v0, p0, Lcom/ninesky/browser/view/bg;->a:Ljava/util/List;

    invoke-interface {v0, p1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object p0

    check-cast p0, Lcom/ninesky/browser/provider/b;

    move-object v0, p0

    goto :goto_0
.end method

.method public final getItemId(I)J
    .locals 2

    const-wide/16 v0, 0x0

    return-wide v0
.end method

.method public final getView(ILandroid/view/View;Landroid/view/ViewGroup;)Landroid/view/View;
    .locals 7

    if-nez p2, :cond_1

    iget-object v0, p0, Lcom/ninesky/browser/view/bg;->e:Lcom/ninesky/browser/view/j;

    invoke-static {v0}, Lcom/ninesky/browser/view/j;->a(Lcom/ninesky/browser/view/j;)Landroid/view/LayoutInflater;

    move-result-object v0

    const v1, 0x7f03000b

    const/4 v2, 0x0

    invoke-virtual {v0, v1, v2}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;)Landroid/view/View;

    move-result-object v0

    move-object v3, v0

    :goto_0
    iget-object v0, p0, Lcom/ninesky/browser/view/bg;->a:Ljava/util/List;

    invoke-interface {v0, p1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/ninesky/browser/provider/b;

    const v1, 0x7f0c001b

    invoke-virtual {v3, v1}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v1

    check-cast v1, Landroid/widget/ImageView;

    const v2, 0x7f0c001c

    invoke-virtual {v3, v2}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v2

    check-cast v2, Landroid/widget/TextView;

    iget-object v4, v0, Lcom/ninesky/browser/provider/b;->d:Landroid/graphics/Bitmap;

    if-nez v4, :cond_0

    iget-object v4, p0, Lcom/ninesky/browser/view/bg;->d:Landroid/graphics/Bitmap;

    invoke-virtual {v1, v4}, Landroid/widget/ImageView;->setImageBitmap(Landroid/graphics/Bitmap;)V

    :goto_1
    new-instance v1, Ljava/lang/StringBuffer;

    invoke-direct {v1}, Ljava/lang/StringBuffer;-><init>()V

    iget-object v4, v0, Lcom/ninesky/browser/provider/b;->a:Ljava/lang/String;

    const-string v5, "www."

    const-string v6, ""

    invoke-virtual {v4, v5, v6}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String;

    move-result-object v4

    const-string v5, "https://"

    const-string v6, ""

    invoke-virtual {v4, v5, v6}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String;

    move-result-object v4

    const-string v5, "http://"

    const-string v6, ""

    invoke-virtual {v4, v5, v6}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String;

    move-result-object v4

    const-string v5, "<u>"

    invoke-virtual {v1, v5}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;

    move-result-object v5

    invoke-virtual {v4}, Ljava/lang/String;->toString()Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v5, v4}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;

    move-result-object v4

    const-string v5, "</u>"

    invoke-virtual {v4, v5}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;

    invoke-virtual {v1}, Ljava/lang/StringBuffer;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v1}, Landroid/text/Html;->fromHtml(Ljava/lang/String;)Landroid/text/Spanned;

    move-result-object v1

    invoke-virtual {v2, v1}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    iget-object v0, v0, Lcom/ninesky/browser/provider/b;->b:Ljava/lang/String;

    invoke-virtual {v3, v0}, Landroid/view/View;->setTag(Ljava/lang/Object;)V

    return-object v3

    :cond_0
    invoke-virtual {v1, v4}, Landroid/widget/ImageView;->setImageBitmap(Landroid/graphics/Bitmap;)V

    goto :goto_1

    :cond_1
    move-object v3, p2

    goto :goto_0
.end method

.method public final getViewTypeCount()I
    .locals 1

    const/4 v0, 0x1

    return v0
.end method
